package cn.wolfcode.Enum;

import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@NoArgsConstructor
public enum ConsumptionStatusEnum {
    CONSUME("待结算",0),
    AUDIT("待审核",1),
    FINISH("归档",2),
    FAILURE("坏账",3);

    private Integer value;
    private String name;

    ConsumptionStatusEnum(String name, Integer value) {
        this.value = value;
        this.name = name;
    }


    public static String findName(Integer value){
        ConsumptionStatusEnum[] values = ConsumptionStatusEnum.values();
        for (ConsumptionStatusEnum consumptionStatusEnum : values) {
            if (consumptionStatusEnum.value.equals(value)){
                return consumptionStatusEnum.name;
            }
        }
        return null;
    }
}
